﻿<local:DocumentBase x:Class="WPFExcelReport.MVTVK02"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
       Height="700" Width="1024" 
       Background="White" 
         Loaded="Window_Loaded"
        Title="MVTVK02"  
     >
    <local:DocumentBase.Resources>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>        
        <StackPanel Margin="0,5,0,0" Grid.RowSpan="4" Grid.ColumnSpan="2">
            <WrapPanel >
                <Label Content="下单日期从" Height="26" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label1" VerticalAlignment="Top" Width="87" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="111" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label2" VerticalAlignment="Top" Width="19" FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="113" />
                <Button Content="查询" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="122" Panel.ZIndex="8"
                        Click="btnQuery_Click"/>
                <Button Content="导出" Height="33" Margin="10,0,0,0"  Name="btnEXCEL" Width="122" Panel.ZIndex="9"
                        Click="btnEXCEL_Click"/>
            </WrapPanel>
            <WrapPanel>
                <fd:FilteringDataGrid CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True"
            IsFilteringCaseSensitive="False"
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  Width="1000"
                  Height="600"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.RowSpan="3" Grid.Row="1">
            <!--PI	CUSTOMER	COUNTRY	PROVINCE	MERCHANDISER	ENTRYDATE	ENDCUSTOMER	CURRENCY	TYPE	
                    ARTICLE	COLOR	QTY	QTYUNIT	DELIVERYDATE	PRICE	PRICEUNIT	TOTVALUES-->
                    <fd:FilteringDataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=PI}" Header="PI" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="Customer" Width="SizeToCells" MinWidth="70" MaxWidth="100" />
                        <DataGridTextColumn Binding="{Binding Path=COUNTRY}" Header="Country" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=PROVINCE}" Header="Province" Width="SizeToCells" MinWidth="40" MaxWidth="70"/>
                        <DataGridTextColumn Binding="{Binding Path=MERCHANDISER}" Header="Merchandiser" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ENTRYDATE}" Header="EntryDate" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ENDCUSTOMER}" Header="EndCustomer" Width="SizeToCells" MinWidth="50" MaxWidth="70"/>
                        <DataGridTextColumn Binding="{Binding Path=CURRENCY}" Header="Currency" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=TYPE}" Header="Type" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="Article" Width="SizeToCells" MinWidth="50" MaxWidth="100" />
                        <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="Color" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="Quantity" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=QTYUNIT}" Header="Unit" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=DELIVERYDATE}" Header="DeliveryDate" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=PRICE}" Header="Price" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=PRICEUNIT}" Header="Unit" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=TOTVALUES}" Header="Values" Width="SizeToCells" MinWidth="50" />
                    </fd:FilteringDataGrid.Columns>
                </fd:FilteringDataGrid  >
            </WrapPanel>
        </StackPanel>
    </Grid>
</local:DocumentBase>
